<template>
  <div class="dashboard-container home">
    <Overview :overviewData="overviewData" />
    <Orderview :orderviewData="orderviewData" />
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { getDate, getOrderData } from '@/api/index'
import { getOrderListBy } from '@/api/order'
// 营业数据
import Overview from './components/overview.vue'
// 订单管理
import Orderview from './components/orderview.vue'
@Component({
  name: 'Dashboard',
  components: {
    Overview,
    Orderview,
  },
})
export default class extends Vue {
  private todayData = {} as any
  private overviewData = {}
  private orderviewData = {} as any
  private flag = 2
  private tateData = []
  private dishesData = {} as any
  private setMealData = {}
  private orderListData = []
  private counts = 0
  private page: number = 1
  private pageSize: number = 10
  private status = 2
  private orderStatics = {} as any
  created() {
    this.init()
  }
  init() {
    this.$nextTick(() => {
      this.getOrderData()
      this.getDates()
    })
  }
  // 获取今日数据
  async getDates() {
    const res = await getDate()
    console.log(res)
    this.overviewData = res.data.data
  }
  // // 获取今日订单
  async getOrderData() {
    const res = await getOrderData()
    console.log(res)
    this.orderviewData = res.data.data
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container.home .container {
  border-radius: 20px;
  height: 327px;
}
.overviewBox ul li {
  border-radius: 20px;
}
.orderviewBox ul li {
  border-radius: 20px;
}
li {
  height: 120px;
  position: relative;
  bottom: -60px;
}
</style>
